<template>
    <div class="mask" @click="closeSwiper">
        <div class="wapper">
            <swiper :options="swiperOption" ref="mySwiper">
                <!-- slides -->
                <swiper-slide v-for="(item,index) in swiperList" :key="index" v-if="swiperList.length"><img :src="item" alt=""></swiper-slide>
                <!-- Optional controls -->
                <div class="swiper-pagination"  slot="pagination"></div>
            </swiper>
        </div>
    </div>
</template>

<style scoped>
.mask{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #666666;
    align-items:center; 
    display:flex;
}
.wapper{
    width: 100%;
    background-color: saddlebrown;
}

.wapper >>> .swiper-pagination-bullet-active{
    background-color: #ffffff !important;
}

img{
    width: 100%;
}
</style>

<script>
export default {
    props:['swiperList'],
    data(){
        return{
            title:"画廊",
            swiperOption: {
                pagination:".swiper-pagination"
                // some swiper options/callbacks
                // 所有的参数同 swiper 官方 api 参数
                // ...
            },
        }
    },
    methods:{
        closeSwiper(){
            console.log(22222);
            
            this.$emit("closeSwiper")
        }
    }
}
</script>
